<template>
	<view class="shadowBox" @click="closeModel2()" catchtouchmove="move">
		<view class="showModel" @click.stop>
			<view class="title">提 示</view>
			<view class="content">您确定要取消订阅消息通知吗?</view>
			<view class="btn">
				<button class="left" @click="closeModel2()">取消</button>
				<button class="right" @click="cancelAuthorization()">确定</button>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
			};
		},
		methods:{
			closeModel2(){
				this.$emit("closeModel2",false);
				this.$emit("acceptEvent", 1);
			},
			cancelAuthorization(){//取消授权
				this.$emit("closeModel2",false);
				this.$emit("acceptEvent", 0);
				// wx.openSetting({
				// 	success(res){
				// 		console.log(res);
				// 		if(res.authSetting["scope.address"]){//授权成功
				// 			this.$emit("acceptEvent", 1);
				// 		}else{
				// 			uni.showToast({
				// 				icon: 'none',
				// 				title: '您取消了授权'
				// 			})
				// 			this.$emit("acceptEvent", 0);
				// 		}
				// 	}
				// })
			}
		}
	}
</script>

<style lang="scss">
	.shadowBox{
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 999;
		background-color: rgba(0,0,0,.3);
		.showModel{
			position: relative;
			width: 85%;
			height: 360upx;
			background-color: #fff;
			border-radius: 15upx;
			margin: 0 auto;
			margin-top: 400upx;
			overflow: hidden;
			.title{
				font-size: 30upx;
				text-align: center;
				margin-top: 45upx;
				font-weight: bold;
			}
			.content{
				color: #a9a9aa;
				font-size: 34upx;
				text-align: center;
				padding: 35upx 40upx 0 40upx;
			}
			.btn{
				position: absolute;
				left: 0;
				bottom: 0;
				width: 100%;
				display: flex;
				.left,.right{
					width: 50%;
					height: 100upx;
					line-height: 100upx;
					border-top: 2upx solid #f6f6f6;
					font-size: 32upx;
					text-align: center;
					background-color: #fff;
					color: #000;
					border-radius: 0;
					font-weight: bold;
				}
				.right{
					color: #495b86;
					border-left: 2upx solid #f6f6f6;
				}
			}
		}
	}
</style>
